package org.spring.springcar.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/prop")
@RestController
public class PropertiesController {
    @Value("${spring.datasource.url}")
    private String url;

    @Value("${my.key1}")
    private Integer key1;

    @Value("${my.key2}")
    private Boolean key2;

    @RequestMapping("/read")
    public String readProperties(){
        System.out.println(key1);
        System.out.println(key2);
        return "从配置文件中，读取url: " + url;
    }


}
